//
//  BaseTableViewController.swift
//  DaRings
//
//  Created by 尹琼 on 2023/2/24.
//

import UIKit
import MYModule

open class BaseTableViewController: TableViewController {

    open override func viewDidLoad() {
        super.viewDidLoad()

        
    }
    

    open override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        
        setLogScreenView()
    }
    
   open func setLogScreenView() {
       
       guard let AppName = Bundle.main.infoDictionary?["CFBundleDisplayName"] as? String, AppName == "Da Rings" else {
           return
       }
        
        guard let screenType = self.screenNameType else { return }
        
        FireBaseManager.shared.logScreenView(screenName: screenType, screenClass: self)
        
    }
    
    open var screenNameType: FireBaseScreenNameType? {
         
         let clsStr = "\(self.classForCoder)"
         
        
         if clsStr == "SleepViewController" {
             return .workOutsList
         }
        
        if clsStr == "SingleHeartRateDetailController" {
            return .singleHeartRateDetailPage
        }
        
        if clsStr == "StressDetailViewController" {
            return .singleStressDetailPage
        }
        
        return nil
    }


}
